// 员工相关的接口
import request from '@/utils/request'

// 获取员工列表
export const getEmployeesList = (params) => {
  return request.get('/users', { params })
}

// 获取员工数量
export const getEmployeesCount = () => {
  return request.get('/users/count')
}

// 添加员工接口
export const addEmployees = (data) => {
  return request.post('/auth/local/register', data)
}

// 根据id获取指定员工信息
export const getEmployeesInfo = (id) => {
  return request.get(`/users/${id}`)
}
// 更新员工信息/分配角色
export const editEmployeesInfo = (data) => {
  return request.put(`/users/${data.id}`, data)
}

// 删除员工信息
export const delEmployeesInfo = (id) => {
  return request.delete(`/users/${id}`)
}

// 获取所有角色列表
export const getRolesList = () => {
  return request.get('/roles')
}

